import java.util.Scanner;

/**
 * 美团淘汰分数 - 优化一, 将冒泡排序改成快速排序
 * 作者:夏天
 * qq:1205232048
 */
public class Main05 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int[] score = new int[n];
        int x = scanner.nextInt();
        int y = scanner.nextInt();
        int m = -1;
        int f = 0;
        int t = 0;
        for (int i = 0; i < n; i++) {
            score[i] = scanner.nextInt();
        }
        int start = 0;
        int end = score.length - 1;
        sort(score, start, end);
        int mTemp = 0;
        int xb = 0;
        while ((score[0] <= score[xb]) && (score[xb] <= score[n - 1]) && (xb < n)) {
            mTemp = score[xb];
            for (int i = xb + 1; i < n; i++) {
                if (mTemp == score[i]) {
                    f = f + 1;
                } else {
                    break;
                }
            }
            f = f + xb + 1;
            t = n - f;
            if ((t >= x && t <= y) && (f >= x && f <= y)) {
                m = mTemp;
                break;
            } else {
                if (xb == n - 1) {
                    break;
                } else {
                    xb++;
                }
                f = 0;
            }
        }
        System.out.println(m);
    }
    public static void sort(int[] a, int low, int high) {
        int start = low;
        int end = high;
        int key = a[low];
        while (end > start) {
            while (end > start && a[end] >= key)
                end--;
            if (a[end] <= key) {
                int temp = a[end];
                a[end] = a[start];
                a[start] = temp;
            }
            while (end > start && a[start] <= key)
                start++;
            if (a[start] >= key) {
                int temp = a[start];
                a[start] = a[end];
                a[end] = temp;
            }
        }
        if (start > low) {
            sort(a, low, start - 1);
        }
        if (end < high) {
            sort(a, end + 1, high);
        }
    }
}
